//
//  BinaryFloatingPoint+Extension.swift
//  RF_localRepo
//
//  Created by zrf on 2021/6/8.
//

import Foundation

public extension BinaryFloatingPoint{
    //浮点型转整型
    var i : Int {
        return Int(self)
    }
    /// 小数点后如果只是0，显示整数，如果不是，显示原来的值
     var cleanZero : String {
        if let i = Int(exactly: self) {
            return String(i)
        }
        return String(Double(self))
//        return self.truncatingRemainder(dividingBy: 1) == 0 ? String(format: "%.0f", Double(self) ) : String(Double(self))

    }
}
